package run;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

public class calcTest {

    @Before
    public void setup() {
        System.out.println("Prepare...");
    }

    @After
    public void after() {
        System.out.println("Closing///");
    }

    @Test(expected = Exception.class)
    public void testSum() {
        Calc c = new Calc();

        try {
            if (c.sum(10, 10) != 20) {
                fail("XXlllX");
            }
        } catch (AssertionError e) {
            System.out.println(e.getMessage());
        }
        try {
            assertTrue("Hahalllha", c.sum(10, 10) != 21);
        } catch (AssertionError e) {
            System.out.println(e.getMessage());
        }
        try {
            assertNotNull("Nulllll!", new Object());
        } catch (AssertionError e) {
            System.out.println(e.getMessage());
        }
    }
}
